<?php


function getLanguageName($file)
{  
  $pathInfo = pathinfo($file);
  $extension = $pathInfo['extension'] ? $pathInfo['extension'] : '';
  
  if(file_exists('geshi/geshi/'.$extension.'.php'))
   return $extension;
  
  $defaultExtension = 'c';
  $extensions = array(
   'js'       => 'javascript',
   'phps'     => 'php',
   'htaccess' => 'apache',
   'as'       => 'actionscript3',
   'cs'       => 'csharp',
   'html'     => 'html4strict',
   'htm'      => 'html4strict',
   'tpl'      => 'html4strict'
  );
  if( array_key_exists($extension, $extensions) )
   return $extensions[$extension];
  else
   return $defaultExtension;
}


